package com.nbsaas.boot.user.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 签到奖励实体类
 * 
 * @author 系统生成
 */
@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "签到奖励", model = "签到奖励")
@Entity
@Table(name = "bs_sign_in_reward")
@Comment("签到奖励表")
public class SignInReward extends AbstractEntity {

    @Comment("用户ID")
    @SearchItem(name = "userId", key = "userId", label = "用户ID")
    @FormField(title = "用户ID", sortNum = "1", grid = true, required = true)
    @Column(name = "user_id", nullable = false)
    private Long userId;

    @Comment("签到记录ID")
    @FormField(title = "签到记录ID", sortNum = "2", grid = true, required = true)
    @Column(name = "sign_in_id", nullable = false)
    private Long signInId;

    @Comment("奖励类型")
    @FormField(title = "奖励类型", sortNum = "3", grid = true, type = InputType.select)
    @Column(name = "reward_type", length = 50)
    private String rewardType; // POINTS-积分, MONEY-金额, COUPON-优惠券, GOODS-实物

    @Comment("奖励名称")
    @FormField(title = "奖励名称", sortNum = "4", grid = true, required = true)
    @Column(name = "reward_name", length = 200, nullable = false)
    private String rewardName;

    @Comment("奖励数量")
    @FormField(title = "奖励数量", sortNum = "5", grid = true, type = InputType.el_input_number)
    @Column(name = "reward_quantity", precision = 10, scale = 0)
    private Integer rewardQuantity;

    @Comment("奖励金额")
    @FormField(title = "奖励金额", sortNum = "6", grid = true, type = InputType.el_input_number)
    @Column(name = "reward_amount", precision = 10, scale = 2)
    private BigDecimal rewardAmount;

    @Comment("奖励积分")
    @FormField(title = "奖励积分", sortNum = "7", grid = true, type = InputType.el_input_number)
    @Column(name = "reward_points", precision = 10, scale = 0)
    private Integer rewardPoints;

    @Comment("奖励商品ID")
    @FormField(title = "奖励商品ID", sortNum = "8", grid = true, type = InputType.select)
    @Column(name = "reward_goods_id")
    private Long rewardGoodsId;

    @Comment("奖励优惠券ID")
    @FormField(title = "奖励优惠券ID", sortNum = "9", grid = true, type = InputType.select)
    @Column(name = "reward_coupon_id")
    private Long rewardCouponId;

    @Comment("发放状态")
    @FormField(title = "发放状态", sortNum = "10", grid = true, type = InputType.select)
    @Column(name = "grant_status", length = 20)
    private String grantStatus; // PENDING-待发放, SUCCESS-已发放, FAILED-发放失败

    @Comment("发放时间")
    @FormField(title = "发放时间", sortNum = "11", type = InputType.date, grid = true)
    @Column(name = "grant_time")
    private Date grantTime;

    @Comment("发放备注")
    @FormField(title = "发放备注", sortNum = "12", type = InputType.textarea)
    @Column(name = "grant_remark", length = 500)
    private String grantRemark;

    @Comment("奖励来源")
    @FormField(title = "奖励来源", sortNum = "13", grid = true)
    @Column(name = "reward_source", length = 100)
    private String rewardSource; // DAILY_SIGN-每日签到, CONTINUOUS_SIGN-连续签到, SPECIAL_SIGN-特殊签到

    @Comment("连续签到天数")
    @FormField(title = "连续签到天数", sortNum = "14", grid = true, type = InputType.el_input_number)
    @Column(name = "continuous_days")
    private Integer continuousDays;

    @Comment("是否已使用")
    @FormField(title = "是否已使用", sortNum = "15", grid = true, type = InputType.select)
    @Column(name = "is_used")
    private Boolean isUsed;

    @Comment("使用时间")
    @FormField(title = "使用时间", sortNum = "16", type = InputType.date, grid = true)
    @Column(name = "use_time")
    private Date useTime;

    @Comment("过期时间")
    @FormField(title = "过期时间", sortNum = "17", type = InputType.date, grid = true)
    @Column(name = "expire_time")
    private Date expireTime;
} 